feat: is dev for packages installed under npm and pnpm #9000
+121
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Hey,
My team and I have been experiencing issues with development dependencies being installed even when using the
--omit=dev flag with turbo prune.
I came across the issue discussed here: Issue #1100, particularly the comment outlining the proposed solution.
To help advance the process, I decided to start contributing to this feature. I've begun implementing the first step mentioned:
I've added an
is_dev
flag to each package in the graph, allowing us to identify and remove development dependencies in the later stages of the pruning process.For this MVP, I focused on
npm
andpnpm
, extracting the necessary information directly frompackage-lock.json
/pnpm-lock.yaml
.I haven't implemented this for other package managers like yarn or bun yet, but I can extend it later if needed.
I'd appreciate your feedback on whether this aligns with your intended approach.
If not, could you please provide more direction?
Additional Notes:
Thanks for your time and consideration!
Testing Instructions